package controllers

import (
	"cms/enums"
	"cms/models"
	"github.com/astaxie/beego"
)

type BaseController struct {
	beego.Controller
}

func (c *BaseController) jsonResult(code enums.JsonResultCode, msg string, obj interface{}) {
	c.Data["json"] = &models.JsonResult{code, msg, obj}
	c.ServeJSON()
	c.StopRun()
}
